// Take the logs and do some arithmetic

#include <iostream>
#include <math.h>

using namespace std;

int main()
{
	int N;
	while (cin >> N)
	{
		double LN = log10(N), LN1 = log10(N+1);

		int T = (int)LN + 2;

		while (true)
		{
			double left = (LN + T) / log10(2);
			double right = (LN1 + T) / log10(2);
			
			int E = (int) right;

			if (left <= E && E < right) 
			{
				cout << E << endl;
				break;
			}
			else T++;
		}
	}
	return 0;
}
